During the program development, a programmer needs to debug the program being coded to find grammatical and/or logical error in the source code. A debugger is a common tool for performing debugging. For example, a dedicated debugger is usually provided in an integrated development environment (IDE). During the debugging process, tracking may of variables may need to be performed.
Specifically, during a debugging process, a programmer often needs to check whether a value of a given variable is located within expected range. At present, a watch point may be used to track a value of a variable. Considering C or C++ language as an example, a programmer may use a statement such as “assert” to suspend running of a program at a designated location. Then, a debugger may obtain a value actually stored in a storage address assigned to a variable to be checked, to be available for a user to look up. The watch point is substantively an internal memory break point. In this way, the programmer may look up a value of the variable and other relevant information.
Then, in a traditional solution, in order track a change of a variable value, the programmer must set a watch point for all assignment expressions that might change the variable value in the program. Moreover, assignment expressions that might affect the variable values are usually applied to different variables and/or located in different functions, which not only increases the burden of a programmer, but also is adverse to automation of the variable tracking process. Moreover, before finding the root of unexpected change of a variable value, execution of the program would be possibly interrupted for multiple times.